<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="projectss" class="com.zust.ysc012.service.UploadedService" scope="page"/>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>uploaded</title>
    <meta charset="UTF-8">
    <link href="/total_js/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
    <link href="/total_css/css/sb-admin-2.min.css" rel="stylesheet">
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
    <link href="/total_js/static/bootstrap/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/css/tempusdominus-bootstrap-4.css" />
    <style>
        div.progress {
            display: none;
        }
    </style>
    <script src="/total_js/static/jquery/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="/total_js/static/bootstrap/js/plugins/canvas-to-blob.min.js" type="text/javascript"></script>
    <script src="/total_js/static/bootstrap/js/plugins/sortable.min.js" type="text/javascript"></script>
    <script src="/total_js/static/bootstrap/js/plugins/purify.min.js" type="text/javascript"></script>
    <script src="/total_js/static/bootstrap/js/fileinput.min.js"></script>
    <script src="/total_js/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/total_js/static/bootstrap/themes/fa/theme.js"></script>
    <script src="/total_js/static/bootstrap/js/locales/zh.js"></script>
    <script src="/total_js/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="/total_js/vendor/jquery-easing/jquery.easing.min.js"></script>
    <script src="/total_js/js/sb-admin-2.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.js"></script>
</head>
<body id="page-top">
    <div id="wrapper">
        <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar" style="background-image: none; background-color: #718093;">
            <div class="sidebar-brand d-flex align-items-center justify-content-center">
                <div class="sidebar-brand-icon">
                    <i class="fab fa-android"></i>
                </div>
                <div class="sidebar-brand-text mx-3">${sessionScope.username}<sup>你好</sup></div>
            </div>
            <hr class="sidebar-divider my-0">
            <hr class="sidebar-divider">
            <div class="sidebar-heading">
                方法
            </div>
            <li class="nav-item">
                <a class="nav-link" href="/jumpingServlet?aim=2">
                    <i class="fas fa-fw fa-chart-area"></i>
                    <span>通知</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/jumpingServlet?aim=5">
                    <i class="fas fa-fw fa-folder"></i>
                    <span>竞赛信息</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/jumpingServlet?aim=4">
                    <i class="fas fa-fw fa-table"></i>
                    <span>请求</span></a>
            </li>
            <hr class="sidebar-divider">
            <div class="sidebar-heading">
                未来
            </div>
            <li class="nav-item">
                <a class="nav-link" href="/jumpingServlet?aim=1">
                    <i class="fas fa-fw fa-wrench"></i>
                    <span>空白页</span>
                </a>
            </li>
            <hr class="sidebar-divider d-none d-md-block">
            <div class="text-center d-none d-md-inline">
                <button class="rounded-circle border-0" id="sidebarToggle"></button>
            </div>
        </ul>
        <div id="content-wrapper" class="d-flex flex-column">
            <div id="content">
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
                    <form action="/searchServlet" class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search" >
                        <div class="input-group">
                            <input type="text" class="form-control bg-light border-0 small" placeholder="搜索..." aria-label="Search" aria-describedby="basic-addon2" name="search">
                            <div class="input-group-append">
                                <input type="submit" class="btn btn-primary" value="GO">
                            </div>
                        </div>
                    </form>
                    <div>
                        <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                            <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                            退出
                        </a>
                    </div>
                </nav>
                <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLabel">确定要离开吗?</h5>
                                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">×</span>
                                </button>
                            </div>
                            <div class="modal-body">请确保更新的信息已上传。</div>
                            <div class="modal-footer">
                                <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
                                <a class="btn btn-primary" href="/logoutServlet">确认离开</a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="container-fluid">
                    <h1 class="h3 mb-1 text-gray-800">
                        竞赛信息
                    </h1>
                    <p class="mb-4">
                        可以上传新竞赛题目&nbsp;&nbsp;
                        <a data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo"><strong style="color: burlywood;">上传</strong></a>
                    </p>
                    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabe" aria-hidden="true">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title" id="exampleModalLabe">New Topic</h5>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                                <div class="modal-body">
                                    <form action="/uploadServlet" method="post" enctype="multipart/form-data">
                                        <div class="form-group">
                                            <label for="recipient-name" class="col-form-label">
                                                题目
                                            </label>
                                            <input type="text" class="form-control" id="recipient-name" name="name">
                                        </div>
                                        <div class="form-group" enctype="multipart/form-data">
                                            <label class="control-label">
                                                资料
                                            </label>
                                            <input id="input-43" name="input43" type="file" multiple class="file-loading">
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label">
                                                开始时间
                                            </label>
                                            <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
                                                <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" name="startTime" data-format="yyyy-MM-dd hh:mm:ss"/>
                                                <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
                                                    <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label">
                                                结束时间
                                            </label>
                                            <div class="input-group date" id="datetimepicker2" data-target-input="nearest">
                                                <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker2" name="deadline" data-format="yyyy-MM-dd hh:mm:ss"/>
                                                <div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
                                                    <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <input type="button" class="btn btn-secondary" data-dismiss="modal" value="关闭"/>
                                            <input type="submit" class="btn btn-primary" value="提交"/>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-6">

                            <c:forEach items="<%=projectss.getAllTable2()%>" var="project">
                                    <div class="card mb-4 py-3 border-left-success" style="width:600px;">
                                        <div class="card-body">
                                                ${project.project_name}  ${project.teacher_name}  ${project.starting_time}至${project.deadline}
                                            <a href="/downloadServlet?filename=${project.project_number}" class="btn btn-info btn-circle" style="position: absolute; right: 28px; top: 30px;">
                                                <i class="fas fa-info-circle" style="margin-top: 3px;"></i>
                                            </a>
                                        </div>
                                    </div>
                            </c:forEach>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy;2021 China. All rights reserved.</span>
                    </div>
                </div>
            </footer>
        </div>
    </div>
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>
    <script>
        $(document).on('ready', function() {
            $("#input-43").fileinput({
                showPreview: false,
                allowedFileExtensions: ["zip", "rar", "png", "jpg", "doc", "docx"],
                elErrorContainer: "#errorBlock",
                showUpload: false,
                showCancel:false
            });

            $("#datetimepicker1").datetimepicker({
                // format : 'yyyy',//日期格式。可以将日期格式，定成年月日时，分秒为0。
                // format: 'yyyy-MM-dd hh:ii',
                // autoclose: true,
                bootcssVer:3,
                startView: 1,
                minuteStep: 60,
                minView: "day",
                autoclose:true,//选中关闭
                todayBtn: false,//今日按钮
                // startDate:new Date(),
                locale: moment.locale('zh-cn')
            });
            // $("#datetimepicker1").DateTimePicker1.CustomFormat = "yyyy-MM-dd HH:mm:ss"
            // $("#datetimepicker1").datetimepicker({
            //     // format: "yyyy-mm-dd HH:ii",
            //     // format: "yyyy-mm-dd hh:ii",
            //     language:  'zh-CN',
            //     weekStart: 1,
            //     todayBtn:  1,
            //     autoclose: 1,
            //     todayHighlight: 1,
            //     startView: 2,
            //     forceParse: 0,
            //     maxView:4,
            //     hours12: false
            // });

            $("#datetimepicker2").datetimepicker({
                // format: "yyyy-mm-dd HH:ii"
                // format: "yyyy-mm-dd hh:ii",
                language:  'zh-CN',
                weekStart: 1,
                todayBtn:  1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                forceParse: 0,
                maxView:4,
                hours12: false
            });
        });
    </script>
</body>
</html>
